package cn.xo68.ide.plugin.common.message;

import cn.xo68.ide.plugin.common.job.ToolSuiteJob;
import com.intellij.util.messages.Topic;

/**
 * Notifies about analysis tasks starting and ending. It will be called for any analysis task, regardless of the trigger, if it is brackground or not, etc.
 */
public interface TaskListener {
  Topic<TaskListener> TASK_TOPIC = Topic.create("task start and finish", TaskListener.class);

  void started(ToolSuiteJob job);

  void ended(ToolSuiteJob job);

  abstract class Adapter implements TaskListener {
    @Override
    public void started(ToolSuiteJob job) {
      // can be optionally implemented
    }

    @Override
    public void ended(ToolSuiteJob job) {
      // can be optionally implemented
    }
  }
}